package com.xiami.controller;

import com.xiami.pojo.MyResponseResult;
import com.xiami.pojo.PageBean;
import com.xiami.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/*
创建者:虾米糖
*/
@RestController
public class EmpController {
    @Autowired
    private EmpService empService;
@GetMapping("/emps")
    public MyResponseResult getEmp(@RequestParam(defaultValue = "1") Integer page,
                                   @RequestParam(defaultValue = "5") Integer pageSize) {
    PageBean pageBean = empService.list(page, pageSize);
        return MyResponseResult.ok(pageBean);
    }
}
